/*
 * PKL 51 GUNUNG KIDUL
 * Subseksie DATA ENTRY + CAPI
 */
package pkl51.controller;

import java.util.logging.Level;
import java.util.logging.Logger;
import pkl51.error.EntityException;
import pkl51.model.HomeModel;
import pkl51.util.Message;
import pkl51.view.Home;

/**
 *
 * @author FITRI ANDRI ASTUTI
 */
public class HomeController {
    private HomeModel model;

    public void setModel(HomeModel model) {
        this.model = model;
    }
    
    public void getHomeByNKS(Home home) {
        try {
            model.getHome();
            home.getLabelNimPencacah().setText(model.getNim_pencacah());
            home.getLabelNamaPencacah().setText(model.getNama_pencacah());
            home.getLabelNimKortim().setText(model.getNim_kortim());
            home.getLabelNamaKortim().setText(model.getNama_kortim());

        }
         catch (EntityException ex) {
            Message.errorMessage("Data tidak ditemukan");
            Logger.getLogger(HomeController.class.getName()).log(Level.SEVERE, null, ex);
        }
    
    }
}
